package com.example.lambda;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: 朝花不迟暮
 * @Description: distinct可以去除重复的元素:
 * @Date: 2022/11/4
 */
public class DistinctSample {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("A", "B", "F", "A", "C");
        List<String> temp = list.stream().distinct().collect(Collectors.toList());
        temp.forEach(System.out::println);
    }
}
